//
//  LoanStepView.swift
//  EasyDana
//
//  Created by mac on 2024/10/12.
//

import UIKit
import Kingfisher
class LoanStepView: UIView {
    
    
    var onClickModel: ((LoanProcessViewController.LoanProcessModel.AuthenticationModel)->Void)?
    
    private var _model: LoanProcessViewController.LoanProcessModel.AuthenticationModel?
    var model: LoanProcessViewController.LoanProcessModel.AuthenticationModel?{
        set {
            _model = newValue
            self.titleLabel.text = newValue?.convoys
            self.iconView.kf.setImage(with: URL(string: newValue?.tomb ?? ""))
            self.passedView.isHidden = (newValue?.alive == 1 ? false : true)
        }
        get {
            return _model
        }
    }
    
    @IBOutlet weak var iconView: UIImageView!
    
    @IBOutlet weak var passedView: UIImageView!
    
    @IBOutlet weak var titleLabel: UILabel!
    
    @IBAction func clickAction(_ sender: UIButton) {
        self.onClickModel?(self.model!)
    }
}
